/**
 * Created by sufan on 2016/5/23.
 */
var baseMapurl = "http://192.168.0.6:6080/arcgis/rest/services/longhua/basemap/MapServer";
var lhbasemapurl="http://192.168.0.6:6080/arcgis/rest/services/longhua/basemap/MapServer/WMTS/";
var lhbasemapwms="http://192.168.0.6:6080/arcgis/services/longhua/basemap/MapServer/WMSServer";
var szbasemap="http://gist.sz95000.com/tiles/wmts";
var szlwurl="http://gist.sz95000.com/server/gist/wms";
var jsxmurl="http://192.168.0.6:6080/arcgis/rest/services/longhua/jsxm/MapServer";
var jtghurl="http://192.168.0.6:6080/arcgis/rest/services/longhua/jtgh/MapServer";
var jtwxhurl="http://192.168.0.6:6080/arcgis/rest/services/longhua/jtwxh/MapServer";
var jtxz="http://192.168.0.6:6080/arcgis/rest/services/longhua/jtxz/MapServer";
var zhjtgh="http://192.168.0.6:6080/arcgis/rest/services/longhua/zhjtgh/MapServer";

var projec4326= ol.proj.get('EPSG:4326');

var map = new ol.Map({
    layers: [
        new ol.layer.Tile({
            source: new ol.source.TileArcGISRest({
                url: zhjtgh,
                projection:projec4326,
                params:{DPI:"96"}
            })
        }),
        new ol.layer.Tile({
            opacity: 1,
            source: new ol.source.XYZ({
                url:baseMapurl+'/tile/{z}/{y}/{x}'
            })
        })
    ],
    target: 'mapDiv',
    controls: ol.control.defaults({
        attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
            collapsible: false
        })
    }),
    view: new ol.View({
        center:  ol.proj.transform([114.018, 22.671], 'EPSG:4326', 'EPSG:3857'),
        zoom: 15
    })
});
